package br.com.cadele.service;

import java.io.Serializable;
import java.util.ArrayList;

import br.com.cadele.dao.DisciplinaDAO;
import br.com.cadele.model.Disciplina;

public class DisciplinaService implements Serializable{

	private static final long serialVersionUID = 7262588019473963714L;
	private DisciplinaDAO disciplinaDAO;
	
	public DisciplinaService() {
		disciplinaDAO = new DisciplinaDAO();
	}
	
	public ArrayList<Disciplina> getAll(){
		return disciplinaDAO.executeQuery("SELECT * FROM disciplina");
	}

	public void executeInsert(Disciplina disciplina){
		StringBuilder query = new StringBuilder();
		query.append("INSERT INTO disciplina VALUES ('");
		query.append(disciplina.getCodigo()+"','");
		query.append(disciplina.getNome()+"','");
		query.append(disciplina.getModulo()+"','");
		query.append(disciplina.getBibliografia()+"','");
		query.append(disciplina.getEmenta()+"','");
		query.append(disciplina.getSemestreVigencia()+"','");
		query.append(disciplina.getMetodologia()+"','");
		query.append(disciplina.getConteudoProgramatico()+"','");
		query.append(disciplina.getCargaHoraria()+"')");
		disciplinaDAO.executeSQL(query.toString());
	}
	public void executeUpdate(Disciplina disciplina, long id){
		//TODO
		disciplinaDAO.executeQuery("");
	}
	
	public void executeDelete(Disciplina disciplina){
		//TODO
		disciplinaDAO.executeQuery("");
	}
}
